# import torch
import torch.nn as nn
# from backbone import Resnet50
# from hybrid_encoder import HybridEncoder
# from transformer import RTDETRTransformer


class RTDETR(nn.Module):
    def __init__(self, backbone=None, encoder=None, decoder=None):
        super().__init__()
        self.backbone = backbone
        self.encoder  = encoder
        self.decoder  = decoder

    def forward(self, x):
        x = self.backbone(x)
        x = self.encoder(x)
        x = self.decoder(x)
        return x
    

# if __name__ == '__main__':
#     backbone = Resnet50()
#     encoder = HybridEncoder()
#     decoder = RTDETRTransformer()
#     model = RTDETR(backbone, encoder, decoder).to('cuda')
#     x = torch.randn([2, 3, 640, 640]).to('cuda')
#     out = model(x)
#     print(out)